import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.Date;
import java.util.Objects;

/**
 * @Title: Two
 * @Author kerry
 * @Package PACKAGE_NAME
 * @Date 2024/11/20 21:16
 */

public class Two {
    public static void main(String[] args) {
        // 面向对象

        // 对象与对象变量解释
        Date birthday = new Date();
        System.out.println(birthday.toString());

        Date deadline;

        LocalDate now = LocalDate.now();
        // 年
        int year = now.getYear();
        System.out.println(year);
        // 月
        int monthValue = now.getMonthValue();
        System.out.println(monthValue);
        // 日
        int dayOfMonth = now.getDayOfMonth();
        System.out.println(dayOfMonth);

        // 星期几
        DayOfWeek dayOfWeek = now.getDayOfWeek();
        System.out.println(dayOfWeek.getValue());// 1~7

        // 构造指定日期
        LocalDate of = LocalDate.of(2024, 10, 20);

        LocalDate localDate = of.plusDays(100);

        LocalDate localDate1 = of.minusDays(100);
        String name = null;

        //Objects.requireNonNull(name,"name不能为null");

        // final
        final StringBuilder b = new StringBuilder();
        b.append("A").append("B").append("C");
        System.out.println(b.toString());//ABC
        b.append("D").append("E").append("F");
        System.out.println(b.toString()); // ABCDEF

        System.out.println(Math.PI);
        Two two = new Two();
        two.e();
    }


    public static void e() {
        System.out.println("我是静态方法");
    }
}
